package com.example.campusproject.slice;

import com.example.campusproject.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.Text;
import ohos.agp.window.dialog.ToastDialog;

/**
 * 学校生活
 */
public class XXSHAbilitySlice extends AbilitySlice {
    private Text tv_xqpmt, tv_xyfj, tv_xszn, tv_fh;

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        this.setUIContent(ResourceTable.Layout_ability_xxsh);
        tv_xqpmt = (Text) this.findComponentById(ResourceTable.Id_tv_xqpmt);
        tv_xyfj = (Text) this.findComponentById(ResourceTable.Id_tv_xyfj);
        tv_xszn = (Text) this.findComponentById(ResourceTable.Id_tv_zszn);
        tv_fh = (Text) this.findComponentById(ResourceTable.Id_tv_return);

        tv_xqpmt.setClickedListener(listener->present(new XQPMTAbilitySlice(),new Intent()));
        tv_xyfj.setClickedListener(listener->present(new XYFJAbilitySlice(),new Intent()));
        tv_xszn.setClickedListener(listener->present(new XSZNAbilitySlice(),new Intent()));
        tv_fh.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //释放当前内存，返回上一界面
                terminate();
            }
        });


    }
}
